/*
 * @Author: szx
 * @Date: 2021-12-01 13:14:05
 * @LastEditTime: 2021-12-01 13:16:52
 * @Description:
 * @FilePath: \leetcode\100-199\167\167.js
 */
var twoSum = function (numbers, target) {
    let l = 0,
        r = numbers.length - 1;
    while (l < r) {
        if (numbers[l] + numbers[r] == target) {
            return [l + 1, r + 1];
        } else if (numbers[l] + numbers[r] < target) {
            l++;
        } else {
            r--;
        }
    }
    return [];
};